package hn.sigit.view;

import java.util.MissingResourceException;

import org.jboss.seam.Component;
import org.jboss.seam.core.SeamResourceBundle;
import org.jboss.seam.annotations.Name;

@Name("resBundle")
public class ResourceBundleHelper {
	private SeamResourceBundle resourceBundle;
	
	public ResourceBundleHelper() {
	}
	
	public String loadMessage(String str) {
		resourceBundle = (SeamResourceBundle)Component.getInstance("org.jboss.seam.core.resourceBundle");
		String retval = "";

		try {
			retval = resourceBundle.getString(str);
		}
		catch (MissingResourceException mre) {
			retval = str;
		}
		catch (NullPointerException npe) {
			retval = str;
		}
		
		return retval;
	}
}
